package map.hasmap_;

import java.security.Key;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class hamp {
    public static void main(String[] args) {
        Map map = new HashMap<>();
        map.put("no1", "李嘉豪");
        map.put("no2", "张无忌");
        //System.out.println(map);
        map.put("no1", "cai");
        //System.out.println(map);
        map.put("no3", "mmp");
        System.out.println(map.get("no1"));
        map.put(1, 0);
        Object m=map.get(1);
        int a=(int)m+1;
        map.put(1, a);
        System.out.println(map.get(1));
        System.out.println(map);
        //System.out.println(map.containsKey(1));
        /*Set kst = map.keySet();
        for(Object key :kst){
            System.out.println(key+" "+map.get(key));
        }

        Iterator it= kst.iterator();
        while (it.hasNext()){
            Object key =it.next();
            System.out.println(key+" "+map.get(key));
        }*/
        Collection values = map.values();
        for(Object va:values){
            System.out.println(va);
        }
        Set est = map.entrySet();
        for (Object entry:est){
            Map.entry(null, null);
        }
    }
}
